let stu = {
    id:1,
    name:"xiaofei",
    classes:{
        id:1,
        name:"web10期"
    }
}

let stu2 = {...stu,name:"xiaowang"}
let stu3 = {...stu,name:"xiaowang"}

console.log(stu2);
console.log(stu2.classes == stu3.classes);

//局限的。我明确知道classes是对象
let stu4 = {...stu,classes:{...stu.classes}}
console.log(stu4.classes == stu.classes);

//JSON.stringify这个api将JS对象转化为json字符串。
//JSON.parse()将字符串转化为JS对象。
let stu5 = JSON.parse(JSON.stringify(stu))
console.log(stu5.classes == stu.classes);

let temp = {
    name:/[0-9]{5}/
}


let user = {
    id:1,
    name:"xiaofei",
    teacher:{
        id:1,
        name:"Mr xu",
        company:{
            id:1
        }
    }
}


